#include "ThreadPool.h"
#include <iostream>

ThreadPool::ThreadPool() {}

void ThreadPool::setMode(PoolMode mode) { this->poolMode_ = mode; }

void ThreadPool::setTaskQueMaxThreshold(size_t threshold) {
  this->taskQueThreshHold_ = threshold;
}

// void ThreadPool::setInitThreadSize(size_t size) {
//   this->initThreadSize_ = size;
// }

void ThreadPool::submitTask(std::shared_ptr<Task> Tasksptr) {};

void ThreadPool::start(size_t initThreadSize) {
  this->initThreadSize_ = initThreadSize;

  for (int i = 0; i < initThreadSize_; i++) {
    threads_.emplace_back(new Thread([this] {
      threadFunc();
    }));
  }

  for (int i = 0; i < initThreadSize_; i++) {
    threads_[i]->start();
  }
}

void ThreadPool::threadFunc() {
  std::cout << "begin threadFunc" << "\n";
  std::cout << std::this_thread::get_id() << "\n";
  std::cout << "end threadFunc" << "\n";
}